package main.SQL;

import java.sql.ResultSet;
import java.sql.SQLException;

public class SQLRsrc {

    private int rsrcId;
    private String rsrcShortName;
    private String rsrcType, uom;
    private String rsrcName;
    private int parentRsrcId;


    public SQLRsrc(int rsrcId, String rsrcShortName, String rsrcType, String rsrcName, int parentRsrcId, String uom) {
        this.rsrcId = rsrcId;
        this.rsrcShortName = rsrcShortName;
        this.rsrcType = rsrcType;
        this.rsrcName = rsrcName;
        this.parentRsrcId = parentRsrcId;
        this.uom = uom;
    }

    public SQLRsrc(ResultSet rs) throws SQLException {

        this.rsrcId = rs.getInt("rsrc_id");
        this.rsrcShortName = rs.getString("rsrc_short_name");
        this.rsrcType = rs.getString("rsrc_type");
        this.rsrcName = rs.getString("rsrc_name");
        this.parentRsrcId = rs.getInt("parent_rsrc_id");
        this.uom = rs.getString("uom");
    }

    public int getRsrcId () { return rsrcId; }

    public String getRsrcShortName () { return rsrcShortName; }

    public String getRsrcType () { return rsrcType; }

    public String getRsrcName () { return rsrcName; }

    public int getParentRsrcId () { return parentRsrcId; }

    public String getUom() {
        return uom;
    }

    public void setUom(String uom) {
        this.uom = uom;
    }
}
